﻿using System;
using System.Collections.Generic;
using System.Text;
using static NP.BPMReportPlatform.RecurringJobs.Dto.SFPerformDto.SFFormStepResponse;
using static NP.BPMReportPlatform.RecurringJobs.Dto.SFPerformDto.SFFormTitleResponse;

namespace NP.BPMReportPlatform.RecurringJobs.Dto
{
    public class SFPerformDto
    {
        /// <summary>
        /// 绩效考评待办实体
        /// </summary>
        public class SFToDoResponse
        {
            /// <summary>
            /// 岗位实体
            /// </summary>
            public class SFToDo
            {
                public SFToDoResult d { get; set; }
            }

            /// <summary>
            /// 中间结构
            /// </summary>
            public class SFToDoResult
            {
                /// <summary>
                /// 结果
                /// </summary>
                public List<SFToDoData> results { get; set; }
            }

            /// <summary>
            /// 数据
            /// </summary>
            public class SFToDoData
            {
                /// <summary>
                /// 待办id
                /// </summary>
                public int todoEntryId { get; set; }

                /// <summary>
                /// 待办名称
                /// </summary>
                public string todoEntryName { get; set; }

                /// <summary>
                /// 最后更新日期
                /// </summary>
                public string lastModifiedDateTime { get; set; }

                /// <summary>
                /// 链接
                /// </summary>
                public string linkUrl { get; set; }

                /// <summary>
                /// 评估绩效
                /// </summary>
                public string categoryLabel { get; set; }
                /// <summary>
                /// 处理人
                /// </summary>
                public string userId { get; set; }
                /// <summary>
                /// 表单类型 绩效=0
                /// </summary>
                public int categoryId { get; set; }

                /// <summary>
                /// 绩效考核人
                /// </summary>
                public string subjectId { get; set; }

                /// <summary>
                /// 步骤情况
                /// </summary>
                public SFFormContentNavResult formContentNav { get; set; }

            }

            public class SFFormContentNavResult
            {
                /// <summary>
                /// 结果
                /// </summary>
                public List<SFFormContentNavData> results { get; set; }
            }

            public class SFFormContentNavData
            {
                public FormHeaderData formHeader { get; set; }
            }

            /// <summary>
            /// 数据
            /// </summary>
            public class FormHeaderData
            {
                /// <summary>
                /// 表单id
                /// </summary>
                public int formDataId { get; set; }

                // 当前步骤
                public string currentStep { get; set; }

                /// <summary>
                /// 表单名称
                /// </summary>
                public string formTitle { get; set; }

                /// <summary>
                /// 表单模版
                /// </summary>
                public int formTemplateId { get; set; }

                public FormTemplate formTemplate { get; set; }
            }

            public class FormTemplate
            {
                public string formTemplateName { get; set; }
            }
        }

        /// <summary>
        /// 表单数据
        /// </summary>
        public class SFFormTitleResponse
        {
            /// <summary>
            /// 入口实体
            /// </summary>
            public class SFFormTitle
            {
                public SFFormTitleResult d { get; set; }
            }

            /// <summary>
            /// 中间结构
            /// </summary>
            public class SFFormTitleResult
            {
                /// <summary>
                /// 
                /// </summary>
                public List<SFFormContents> results { get; set; }
            }

            /// <summary>
            /// 中间结构
            /// </summary>
            public class SFFormContents
            {
                /// <summary>
                /// 
                /// </summary>
                public SFformContent formContents { get; set; }
            }

            public class SFformContent
            {
                /// <summary>
                /// 
                /// </summary>
                public List<SFFormContentsResult> results { get; set; }
            }

            /// <summary>
            /// 中间结构
            /// </summary>
            public class SFFormContentsResult
            {
                /// <summary>
                /// 结果
                /// </summary>
                public PmReviewContentDetail pmReviewContentDetail { get; set; }
            }

            public class PmReviewContentDetail
            {
                public List<Sections> results { get; set; }
            }

            public class Sections
            {
                public MetaData __metadata { get; set; }

                /// <summary>
                /// 业务目标
                /// </summary>
                public ObjectiveSectionsResult objectiveSections { get; set; }

                /// <summary>
                /// 价值观
                /// </summary>
                public CompetencySectionsResult competencySections { get; set; }

                /// <summary>
                /// 综合评价
                /// </summary>
                public CustomSectionsResult customSections { get; set; }

                /// <summary>
                /// 确认结果
                /// </summary>
                public SummarySectionResult summarySection { get; set; }
            }

            public class SummarySectionResult
            {
                public OverallFormRating overallFormRating { get; set; }
            }

            public class OverallFormRating
            {
                public string ratingLabel { get; set; }
                public string textRating { get; set; }
            }

            public class ObjectiveSectionsResult
            {
                public List<ObjectiveSectionData> results { get; set; }
            }

            public class CompetencySectionsResult
            {
                public List<CompetencySectionsData> results { get; set; }
            }

            public class CustomSectionsResult
            {
                public List<CustomSectionsData> results { get; set; }
            }

            // 下面是数据

            /// <summary>
            /// 业务章节数据
            /// </summary>
            public class ObjectiveSectionData
            {
                /// <summary>
                /// 路径
                /// </summary>
                public MetaData __metadata { get; set; }

                /// <summary>
                /// 章节id
                /// </summary>
                public int sectionIndex { get; set; }

                /// <summary>
                /// 章节名称
                /// </summary>
                public string sectionName { get; set; }

                /// <summary>
                /// 描述
                /// </summary>
                public string sectionDescription { get; set; }

                /// <summary>
                /// 权重
                /// </summary>
                public string sectionWeight { get; set; }

                /// <summary>
                /// 表单id
                /// </summary>
                public int formDataId { get; set; }

                /// <summary>
                /// 章节id
                /// </summary>
                public int formContentId { get; set; }

                /// <summary>
                /// 表单数据
                /// </summary>
                public Objectives objectives { get; set; }
            }

            public class CustomSectionsData
            {
                /// <summary>
                /// 路径
                /// </summary>
                public MetaData __metadata { get; set; }

                /// <summary>
                /// 章节id
                /// </summary>
                public int sectionIndex { get; set; }

                /// <summary>
                /// 章节名称
                /// </summary>
                public string sectionName { get; set; }

                public CustomElementResult customElement { get; set; }
            }

            /// <summary>
            /// 需要抓出来的数据（价值观）
            /// </summary>
            public class CompetencySectionsData
            {
                public MetaData __metadata { get; set; }

                /// <summary>
                /// 章节id
                /// </summary>
                public int sectionIndex { get; set; }

                /// <summary>
                /// 章节名称
                /// </summary>
                public string sectionName { get; set; }

                /// <summary>
                /// 具体业务
                /// </summary>
                public CompetenciesResult competencies { get; set; }
            }

            public class CompetenciesResult
            {
                /// <summary>
                /// 结果
                /// </summary>
                public List<CompetenciesData> results { get; set; }
            }

            /// <summary>
            /// 价值观数据
            /// </summary>
            public class CompetenciesData
            {
                public MetaData __metadata { get; set; }
                public string name { get; set; }
                public string description { get; set; }
                public CustomElementResult customElement { get; set; }
            }

            public class Objectives
            {
                /// <summary>
                /// 结果
                /// </summary>
                public List<ObjectivesData> results { get; set; }
            }

            /// <summary>
            /// 数据
            /// </summary>
            public class ObjectivesData
            {
                public MetaData __metadata { get; set; }
                public string itemId { get; set; }
                public string name { get; set; }
                public ObjectiveDetailsResult objectiveDetails { get; set; }

                /// <summary>
                /// key
                /// </summary>
                public CustomElementResult customElement { get; set; }
            }

            public class CustomElementResult
            {
                public List<CustomElementData> results { get; set; }
            }

            public class ObjectiveDetailsResult
            {
                public List<ObjectiveDetailsData> results { get; set; }
            }

            /// <summary>
            /// 需要抓出来的数据
            /// </summary>
            public class ObjectiveDetailsData
            {
                public MetaData __metadata { get; set; }

                /// <summary>
                /// 标题名称
                /// </summary>
                public string label { get; set; }

                /// <summary>
                /// 值
                /// </summary>
                public string value { get; set; }

                /// <summary>
                /// 标题key值
                /// </summary>
                public string fieldId { get; set; }
            }
        }

        /// <summary>
        /// 审批步骤获取
        /// </summary>
        public class SFFormStepResponse
        {
            /// <summary>
            /// 入口实体
            /// </summary>
            public class SFFormStep
            {
                public SFFormStepResult d { get; set; }
            }

            /// <summary>
            /// 中间结构
            /// </summary>
            public class SFFormStepResult
            {
                /// <summary>
                /// 
                /// </summary>
                public List<SFFormRouteMapResult> results { get; set; }
            }

            /// <summary>
            /// 中间结构
            /// </summary>
            public class SFFormRouteMapResult
            {
                /// <summary>
                /// 
                /// </summary>
                public RouteStep formRouteMap { get; set; }
            }

            /// <summary>
            /// 中间结构
            /// </summary>
            public class RouteStep
            {
                /// <summary>
                /// 
                /// </summary>
                public RouteStepResult routeStep { get; set; }
            }

            public class RouteStepResult
            {
                /// <summary>
                /// 
                /// </summary>
                public List<SFRouteStepData> results { get; set; }
            }

            /// <summary>
            /// 中间结构
            /// </summary>
            public class SFRouteStepData
            {
                public int formDataId { get; set; }
                public string stepName { get; set; }
                public string stepId { get; set; }
                public string userId { get; set; }
                public string userRole { get; set; }
                public string userFullName { get; set; }
                public RouteSubStep routeSubStep { get; set; }
            }

            public class RouteSubStep
            {
                public List<RouteSubStepResult> results { get; set; }
            }

            public class RouteSubStepResult
            {
                public string userId { get; set; }
                public string userRole { get; set; }
                public string userFullName { get; set; }
            }
        }

        public class SFHistoryResponse
        {
            /// <summary>
            /// 入口实体
            /// </summary>
            public class SFHistory
            {
                public SFHistoryResult d { get; set; }
            }

            /// <summary>
            /// 中间结构
            /// </summary>
            public class SFHistoryResult
            {
                /// <summary>
                /// 
                /// </summary>
                public List<SFHistoryData> results { get; set; }
            }

            public class SFHistoryData
            {
                public int formDataId { get; set; }
                public string currentStep { get; set; }
                public string formSubjectId { get; set; }
                public string formDataStatus { get; set; }
                public string formLastModifiedDate { get; set; }
                public string formReviewDueDate { get; set; }
                public string formReviewEndDate { get; set; }
                public string formReviewStartDate { get; set; }
                public string formTitle { get; set; }
                public int formTemplateId { get; set; }

                public string formTemplateName { get; set; }
            }
        }

        public class SFLastFormResponse
        {
            /// <summary>
            /// 入口实体
            /// </summary>
            public class SFLastFormTitle
            {
                public SFLastFormTitleResult d { get; set; }
            }

            /// <summary>
            /// 中间结构
            /// </summary>
            public class SFLastFormTitleResult
            {
                /// <summary>
                /// 
                /// </summary>
                public List<SFLastFormContents> results { get; set; }
            }

            /// <summary>
            /// 中间结构
            /// </summary>
            public class SFLastFormContents
            {
                public string formSubjectId { get; set; }

                public string formTitle { get; set; }

                public RouteStep formRouteMap { get; set; }
                /// <summary>
                /// 
                /// </summary>
                public SFFormContentsResult formLastContent { get; set; }
            }
        }

        /// <summary>
        /// 需要抓出来key关键结果
        /// </summary>
        public class CustomElementData
        {
            public MetaData __metadata { get; set; }
            public string elementKey { get; set; }
            public int sectionIndex { get; set; }
            public int itemId { get; set; }
            public int formContentId { get; set; }
            public int formDataId { get; set; }
            public string name { get; set; }
            public string valueKey { get; set; }
            public string type { get; set; }
            public string value { get; set; }

            public ElementListResult elementListValues { get; set; }
        }

        public class ElementListResult
        {
            public List<ElementListData> results { get; set; }
        }

        public class ElementListData
        {
            public string name { get; set; }
            public string value { get; set; }
        }
    }

    public class SFPerformPushResponse
    {
        public class SFPerformPush
        {
            public List<SFPerformPushData> d { get; set; }
        }

        public class SFPerformPushData
        {
            public string status { get; set; }
            public string message { get; set; }
        }
    }

    public class MetaData
    {
        public string uri { get; set; }
        public string type { get; set; }
    }
}
